<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    
    <h:head> 
    </h:head> 
    <h:body>	
    	<p:tabView id="tabView" activeIndex="#{homeViewBean.activeTab}">  
    	<p:ajax event="tabChange" listener="#{homeViewBean.changeTab}"></p:ajax>
	    <p:tab id="tab1" title="Register">  
	        <h:form>
	            <h:panelGrid columns="2">
	                <h:outputText value="Name"></h:outputText>
	                <h:inputText value="#{registerBean.name}"></h:inputText>
	                <h:outputText value="Password"></h:outputText>
	                <h:inputSecret value="#{registerBean.password}"></h:inputSecret>
	                <h:outputText value="Repeat Password"></h:outputText>
	                <h:inputSecret value="#{registerBean.passwordRepeat}"></h:inputSecret>
	            </h:panelGrid>
	            <h:commandButton value="Register" action="#{registerBean.register}"></h:commandButton>
       		</h:form>
	    </p:tab>  
	  
	    <p:tab id="tab2" title="Log in">  
	        <h:form>
	            <h:panelGrid columns="2">
	                <h:outputText value="Name"></h:outputText>
	                <h:inputText value="#{loginBean.uname}"></h:inputText>
	                <h:outputText value="Password"></h:outputText>
	                <h:inputSecret value="#{loginBean.password}"></h:inputSecret>
	            </h:panelGrid>
	            <h:commandButton value="Login" action="#{loginBean.loginProject}" update=":tab2" ></h:commandButton>
       		</h:form>
	    </p:tab>   
	</p:tabView>
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> 
   	</h:body> 
</html>